<template>
	<view style="width: 100%;height: 100%;">
		<view style="width: 750rpx;height: 100vh;">
			<map type="gcj02" v-if="lat" style="width: 100%; height: 100%;" :latitude="lat" :longitude="long" :markers="covers" @tap="openMap()"></map>
		</view>
		<div id="allmap"></div>
	</view>
</template>

<script>
	// import baidu-map from '../../../static/ma'
	export default{
		data() {
			return{
			// 	latitude: 31.7335,
			
			// 	longitude: 118.1024,
			// 	covers: [
				
			// 	  {
			
			// 		latitude: 31.7335,//纬度，范围为-90~90，负数表示南纬
			
			// 		longitude: 118.1024,//经度，范围为-180~180，负数表示西经
			
			// 	  },
			// 	  {
					
			// 		latitude: 39.90,
					 
			// 		longitude: 116.39,  
					  
			// 	  }
			
			// 	],
				covers: [],
				lat: '',
				long: '',
				address: ''
			}
		},
		onLoad(option) {
			this.lat = option.lat
			this.long = option.long
			this.address = option.address
			console.log(parseFloat(this.lat),'map地图lat')
			console.log(parseFloat(this.long),'map地图long')
			this.covers.push({
				latitude: option.lat,
				longitude: option.long
			})
		},
		methods:{
			openMap() {//点击地图
			let that = this
			console.log(that.lat)
			console.log(that.long)
			console.log(that.address)
			uni.openLocation({
			  type: 'gcj02',
			  latitude: parseFloat(that.lat,'map地图lat1111'),
			  longitude: parseFloat(that.long,'map地图lat1111'),
			  name:that.address,
			  address: that.address
			
			})
			
		}
		}
	}
</script>

<style>
</style>
